<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="base" value="${pageContext.request.contextPath}" />
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>任务状态</title>
    <link rel="stylesheet" href="${base}/fonts/iconfont.css" />
    <link rel="stylesheet" href="${base}/css/app.css" />
    <link rel="stylesheet" href="${base}/css/mui.min.css" />
    <link rel="stylesheet" href="${base}/css/style.css" />
    <script src="${base}/js/mui.min.js"></script>
    <script src="${base}/js/adaptive.js"></script>
    <script src="${base}/js/jquery-1.10.1.min.js"></script>
    <script src="${base}/js/style.js"></script>
    <script src="${base}/js/template-web.js"></script>
    <script type="text/javascript">
        var base = "${base}";
    </script>
    <script src="${base}/js/taskDetail.js"></script>
    <link rel="stylesheet" href="${base}/css/taskDetail.css" />
    <link rel="stylesheet" href="${base}/css/taskProgress.css" />
</head>
<body>
<!--顶部导航-->
<div class="topNav clearfix">
    <span class="topNavTxt">任务详情</span>
</div>
<!--任务详情-->
<div class="taskDetailWrap">
    <div class="taskDetail">
        <c:choose>
            <c:when test="${order ne null}">
                <div class="taskDetailList" data-id="${order.id}">
                    <h2>${order.orderTitle}</h2>
                    <p>>${order.orderDesc}</p>
                </div>
                <div class="taskContactDetail">
                    <div class="taskContactAddress">
                        <i class="icon iconfont icon-ditu"></i>
                        <span>${order.reAddress}</span>
                    </div>
                    <div class="taskContactTime">
                        <i class="icon iconfont icon-shijian"></i>
                        <span><fmt:formatDate type="both" value="${order.reBeginTime}" /><c:if test="${order.reEndTime ne null}" >-<fmt:formatDate type="both" value="${order.reEndTime}" /></c:if></span>
                    </div>
                    <c:if test="${order.reAccountId==tAccount.id || tAccount.id==order.heAccountId}" >
                        <div class="taskContactPhone">
                            <i class="icon iconfont icon-shouji"></i>
                            <span>${order.tel}</span>
                        </div>
                    </c:if>
                </div>
                <p>温馨提示：此平台暂不提供金额交易，悬赏金额在线下双方协商解决</p>
                <c:if test="${order.reAccountId eq null && order.heAccountId ne tAccount.id}">
                    <div class="taskDetailBtn">
                        <button type="button" class="taskSubmit mui-btn mui-btn-primary" onclick="goorder('${order.id}')">立即执行</button>
                        <button type="button" class="mui-btn taskDetailCancel" onclick="cancelOrder('${order.id}')">残忍弃单</button>
                    </div>
                </c:if>
            </c:when>
            <c:otherwise>
                无相关访问权限
            </c:otherwise>
        </c:choose>
    </div>
</div>
<!--底部导航-->
<div class="foot">
    <nav class="mui-bar mui-bar-tab">
        <a class="mui-tab-item" href="${base}/index.html">
				<span class="mui-icon navIcon">
					<i class="icon iconfont icon-shouye"></i>
				</span>
            <span class="mui-tab-label navTxt">首页</span>
        </a>
        <a class="mui-tab-item" href="${base}/sigin2">
				<span class="mui-icon navIcon">
					<span class="mui-badge" id="myordercount">0</span>
					<i class="icon iconfont icon-fabu"></i>
				</span>
            <span class="mui-tab-label navTxt">发布</span>
        </a>
        <a class="mui-tab-item" href="${base}/myhome/index.html">
				<span class="mui-icon navIcon">
					<i class="icon iconfont icon-wode"></i>
				</span>
            <span class="mui-tab-label navTxt">我的</span>
        </a>
    </nav>
</div>

<script type="text/javascript">
    mui.ajax(base+"/order/mySendOrderCount",{
        dataType:'json',//服务器返回json格式数据
        headers:{'Content-Type':'application/x-www-form-urlencoded'},
        type:'post',//HTTP请求类型
        timeout:10000,//超时时间设置为10秒；
        success:function(data){
            $("#myordercount").text(data.data||0);
        }
    });
</script>
</body>
</html>